import { Model } from './data'

const model: Model = {
  namespace: 'counter',
  state: { num: 0 },
  actions: {
    add: (state) => ({
      ...state,
      num: state.num + 1,
    }),
    minus: (state) => ({
      ...state,
      num: state.num - 1,
    }),
  },
}

export default model
